POV-Ray : Newsgroups : povray.unofficial.patches : Some ideas about SDL enhancements : Some ideas about SDL enhancements Server Time
3 Jul 2024 05:22:48 EDT (-0400)
  Some ideas about SDL enhancements  
From: Warp
Date: 31 Mar 2003 15:02:17
Message: <3e889ec9@news.povray.org>
This is a really old subject, discussed a thousand times already, but
anyways, I thought about writing some of the ideas that have occurred to
me about what new features in the POV-Ray SDL would be great.
  Some of the ideas are old, but I thought that I would make a complete
list of what I think.
  I'm posting this to this group in case some patch maker could get some
inspiration for a new feature (I could try to implement these myself, but
I really don't have the time now...).
  These are features which should not be too difficult to implement.



  * Assigment shortcut operators.

  That is, +=, -=, *= and /=.
  The advantage is clear with statements like:

#declare Array[Index1*a*b+1][Index2] += 2;


  * #do - #until

  The advantage of this is that the loop condition is checked after the
loop body has been parsed and not before. This is useful for example in
sitations like this:

#do
  #declare Point = <rand(S),rand(S),rand(S)>*2-1;
#until(vlength(Point) <= 1)


  * Array operators for the string type.

  A string could be accessed as an array. For example:

#declare I = MyString[a];

  would be completely equivalent to:

#declare I = asc(substr(MyString, a, 1));

  However, it would not only be a shortcut since this would work as well:

#declare MyString[a] = 65;


  * Float literals written as ascii chars (as in C).

  This way the above could be written as:

#declare MyString[a] = 'A';


  * Binary file reading and writing.

  A read-command which reads (the specified amount of) raw binary data into
a string identifier. In the same way it should be possible to directly
write a string as raw data to a file (IIRC currently this is not possible
because of a bug which causes the value 0 to not be written).
  Also a seeking command would be good.


  * Handling bitmaps with a 2-dimensional color array.

  A function should be added which reads the given image file into a given
identifier, which is created as a 2-dimensional array of colors (exactly
as if created by #declare Image = array[Width][Height];).
  Also every item in POV-Ray which accepts an image should also accept
such array of colors.
  (Note: Functions for reading the image dimensions are not necessary
because such function already exists: dimension_size().)


  * Reading members of the global_settings and camera data with the
dot operator.

  For example, you could do this:

#if(global_settings.max_trace_level < 15)
  global_settings { max_trace_level 15 }
#end

  Sub-blocks inside the global_settings block could be accessed in the
same way, eg:

global_settings.radiosity.error_bound


  * Some way of making dynamic data containers.

  This is a whole lot more complicated issue.
  One way of allowing this is to add support for user-defined abstract
types, for example some type of 'struct' construct in such way that you
can make instantiations of this type. This also requires having a reference
type identifier, which can point to such instantiation.
  This way it would be possible to make, for example, a linked list.
  Members of such struct would be accessed with the dot operator.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.